<!DOCTYPE html>
<html lang="zh-CN">
<title>兑换记录</title>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta content=always name=referrer>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css-wap/swiper.min.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/css-wap/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/css-wap/style.css">
    <script src="__STATIC__/js-wap/jquery-1.11.3.min.js"></script>
    <script src="__STATIC__/js-wap/swiper.min.js"></script>
    <script src="__STATIC__/js-wap/common.js"></script>
    <title></title>
    <script>
        $(function () {
            $(".list-state li").click(
                    function () {
                        $(this).addClass("active").siblings().removeClass("active");
                    }
            )
        })
    </script>
    <style>
        .exchange_time{  width: 100%;  padding: 0 3%;  margin: 5px  auto 0;  overflow: hidden;  font-size: 12px;  line-height: 40px;  color: #333;  background: white;  border-bottom: 1px solid #F6F6F6;  }
        .exchange_time span{  color: #E73F09;  float: right;  display: block;  }
        .exchange_inter{  text-align: right;  font-size: 12px;  line-height: 40px;  color: #333;  width: 100%;  padding: 0 3%;  margin: 2px  auto 0;  background: white;  border-bottom: 1px solid #F6F6F6;  }
        .exchange_inter span{  color: #E73F09;  }
        .ope_form{  width: 100%;  padding: 5px 3%;  background: white;  overflow: hidden;  }
        .ope_form>div{  float: right;  overflow: hidden;  }
        .ope_form>div input{  display: block;  width: 80px;  font-size: 14px;  line-height: 26px;  border: 1px solid #AEAEAE;  border-radius: 4px;  outline: none;  float: left;
            background: none;  margin-right: 8px;  color: #666;  }
        .ope_form>div input:last-child{  margin-right: 0;  }
        .ope_form>div input.confirm{  border: 1px solid #E73F09;  color: #E73F09;  }
    </style>
</head>
<body>
<div class="wrap">
    <div class="header-main">
        <a onclick="history.go(-1)"><img src="__STATIC__/img-wap/back.png" class="back"></a>
        <span class="title">兑换记录</span>
    </div>
    {volist name="data" id="vo"}
    <div class="order-main">
        <div class="content">
            <div class="exchange_time">兑换时间：{:date('Y-m-d H:i:s',$vo.create_time)}
              <span>{$vo.statusText}</span>
            </div>
                <div class="media">

                    <div class="media-left media-middle">
                        <a href="#">
                            <img class="media-object" src="/{$vo.picUrl}" alt="">
                        </a>
                    </div>
                    <div class="media-body">
                        <h4 class="media-heading">{$vo.title}</h4>
                        <div class="price">{$vo.integral}积分</div>
                    </div>
                </div>
            <div class="exchange_inter">共1件商品  实付：<span>{$vo.integral}积分</span></div>
            <div class="ope_form">
               <div>
                   {if condition="$vo.status eq 2"}
                   <input type="submit" value="查看物流" onclick="see_express({$vo.id})">
                   <input type="submit" value="确认收货" class="confirm" onclick="confirm_recharge({$vo.id})">
                   {/if}
               </div>
            </div>
        </div>
    </div>
    {/volist}

</div>
</body>
<script>
   //查看物流
   function see_express(id) {
       $.ajax({
           url: "{:url('mobile/MemberOrder/integral_record')}?order_id=" + id,
           dataType: 'json',
           type: 'post',
           success: function (data) {
               if (data.code == 400) {
                   layer.open({content: data.message, skin: 'msg', time: 2})
               } else {
                   window.location.href = "{:url('mobile/member_order/integral_record')}?status={:input('status')}&order_id=" + id + "&title={:input('title')}";
               }
           },
           error: function () {
               layer.open({content: '网络繁忙,请重试', skin: 'msg', time: 2});
           }
       })
   }
   function back_url() {
       window.location.href = sessionStorage.getItem('integral_index');;
   }
   // 确认收货
   function confirm_recharge(id) {
       $.ajax({
           url: "{:url('mobile/MemberOrder/confirm_recharge')}?order_id=" + id,
           dataType: 'json',
           type:'get',
           success:function (data) {
               if (data.code == 200) {
                   layer.open({content: '确认收货成功', skin: 'msg', time: 2})
                   location.reload();
               }else {
                   layer.open({content: '服务器连接异常', skin: 'msg', time: 2})
               }
           }
       })
   }
</script>
</html>
{include file="public/src" /}